package com.slz3.business.module.messageManagement.mesUser.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.messageManagement.mesUser.domain.MesUser;
import com.slz3.business.module.messageManagement.mesUser.domain.MesUserCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class MesUserResController {

    static Mono<ServerResponse> add(ServerRequest req, MesUser mesUser) {
        if (MesUserResUnsafeValid.add(req, mesUser)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesUserResAtomic.add_$MesUserUpdateLock(req, mesUser);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, MesUserCondition mesUserCondition) {
        if (MesUserResUnsafeValid.delete(req, mesUserCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesUserResAtomic.delete_$MesUserUpdateLock(req, mesUserCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, MesUser mesUser) {
        if (MesUserResUnsafeValid.modify(req, mesUser)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesUserResAtomic.modify_$MesUserUpdateLock(req, mesUser);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (MesUserResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesUserResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (MesUserResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesUserResAtomic.info_$MesUserUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (MesUserResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesUserResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, MesUserCondition mesUserCondition) {
        //
        if (MesUserResUnsafeValid.auditSubmit(req, mesUserCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesUserResAtomic.auditSubmit_$MesUserUpdateLock(req, mesUserCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, MesUserCondition mesUserCondition) {
        if (MesUserResUnsafeValid.audit(req, mesUserCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesUserResAtomic.audit_$MesUserUpdateLock(req, mesUserCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, MesUserCondition mesUserCondition) {
        if (MesUserResUnsafeValid.auditReject(req, mesUserCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesUserResAtomic.auditReject_$MesUserUpdateLock(req, mesUserCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, MesUserCondition mesUserCondition) {
        if (MesUserResUnsafeValid.usingEnable(req, mesUserCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesUserResAtomic.usingEnable_$MesUserUpdateLock(req, mesUserCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, MesUserCondition mesUserCondition) {
        if (MesUserResUnsafeValid.usingDisable(req, mesUserCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return MesUserResAtomic.usingDisable_$MesUserUpdateLock(req, mesUserCondition);
        }
    }

}
